import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueDevTools from 'vite-plugin-vue-devtools'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    VueDevTools(),
  ],
  build: {
    chunkSizeWarningLimit: 1000 * 1024, // 设置警告阈值为 1000 kB
  },
  server: {
    port: 5173, // 开发服务器端口
    open: false, // 启动时自动打开浏览器
    proxy: {
      '/withdraw': {
        target: 'http://47.104.186.201:8284', // 测试服务器
        // target: 'http://172.28.8.21:8285',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/withdraw/, '')
      }
    }
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
